#include<stdio.h>
#include<math.h>

double fun(double list[9])
{
	double average = 0;
	for(int i = 0;i<8;i++)
	{
		average += sqrt((list[i]+list[i+1])/2);
	}
	return average;
}
int main()
{
	double arr[9] = {1.0,2.0,9.3,4.0,4.2,5.5,7.3,6.5,24.2};
	printf("%lf",fun(arr));
	
	return 0;
}
